{% extends "solango/base.html" %}


{% block left_menu %}
<div class="facets">
<ul class="linkType">
 <li><a href="?">See All Results</a></li>
</ul>

{% for key, value in facets.items %}
<h3>{{ key }}</h3>
<ul class="linkType">
  <li>
  {% if value.current %}
    <a class="facet0" href="{{ value.base }}">All</a>
  {% else %}
    <span class="facet0 active">All</span>
  {% endif %}
  </li>
  
  {% for link in value.links %}
  <li>
    {% if link.active %}
      <span class="facet{{ link.level }} active">{{ link.anchor }}</span>
    {% else %}
      <a class="facet{{ link.level }}" href="{{ link.href }}">{{ link.anchor }}</a>
    {% endif %}
    {% if link.count %} ({{ link.count }}) {% endif %}
  </li>
  {% endfor %}
</ul>
{% endfor %}
{% if sort_links %}
<h3>Sort</h3>
<ul>
{% for link in sort_links %}
    {% if link.anchor %}
        <li><a href="{{ link.href }}">{{ link.anchor }}</a></li>
    {% else %}
        <li>{{ link }}</li>
    {% endif %}
{% endfor %}
</ul>
{% endif %}
</div>
{% endblock%}

{% block content %}
	<form action="." method="GET">
		<ul>
		  {{form.as_ul}}
		</ul>
		<input type='submit', value='Search'>
	</form>
	
	<div>
	{% if form.data.q and not paginator.results.documents %}
	No results found for <em>{{form.data.q}}</em>. Please modify your search.
	{% endif %}
	
	{% for doc in paginator.results.documents %}
		{{doc.render_html|safe}}
	{% endfor %}
	</div>
	
    <div class="pagination">
	{% if paginator.has_previous %}
	     <a href="{{ paginator.previous_link }}">&lt;&lt;</a> | 
	{% endif %}
	{% for link in paginator.links %}
	    {% if link.href %}
	        <a href="{{ link.href }}">{{ link.anchor }}</a> |
	    {% else %}
	        {{ link }} |
	    {% endif %}
	{% endfor %}
	{% if paginator.has_next %}
	     <a href="{{ paginator.next_link }}">&gt;&gt;</a>
	{% endif %}
	</div>
	
{% endblock %}
